﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace XGameFrame.Graphic
{
    public abstract partial class ParticleBase
    {
        #region Fields Region
        private Texture2D texture;
        private Vector2 position;
        private Vector2 velocity;
        private float angle;
        private float angularVelocity;
        private float size;
        private Color color;
        private int ttl;
        #endregion

        #region Properties Region

        /// <summary>
        /// Get Particles texture or set it
        /// </summary>
        public Texture2D Texture
        {
            get { return texture; }
            set { texture = value; }
        }

        /// <summary>
        /// Get Particles position or set it
        /// </summary>
        public Vector2 Position
        {
            get { return position; }
            set { position = value; }
        }

        /// <summary>
        /// Get Particles velocity or set it
        /// </summary>
        public Vector2 Velocity
        {
            get { return velocity; }
            set { velocity = value; }
        }

        /// <summary>
        /// Get Particles angle or set it
        /// </summary>
        public float Angle
        {
            get { return angle; }
            set { angle = value; }
        }

        /// <summary>
        /// Get Particles angularvelocity or set it
        /// </summary>
        public float AngularVelocity
        {
            get { return angularVelocity; }
            set { angularVelocity = value; }
        }

        /// <summary>
        /// Get Particles size or set it
        /// </summary>
        public float Size
        {
            get { return size; }
            set { size = value; }
        }

        /// <summary>
        /// Get Particles color or set it
        /// </summary>
        public Color Color
        {
            get { return color; }
            set { color = value; }
        }

        /// <summary>
        /// Get Particles time to life or set it
        /// </summary>
        public int TTL
        {
            get { return ttl; }
            set { ttl = value; }
        }
        #endregion

        #region Constructor Region
        /// <summary>
        /// Constructor for a new ParticleBase
        /// </summary>
        /// <param name="pTexture">Particle Sprite Graphic</param>
        /// <param name="pPosition">Position</param>
        /// <param name="pVelocity">Particle Speed</param>
        /// <param name="pAngle">Rotation angle</param>
        /// <param name="pAngularVelocity">Changing speed of angle</param>
        /// <param name="pColor">Color</param>
        /// <param name="pSize">Size</param>
        /// <param name="pTtl">Time to life</param>
        public ParticleBase(Texture2D pTexture, Vector2 pPosition, Vector2 pVelocity, float pAngle, float pAngularVelocity, Color pColor, float pSize, int pTtl)
        {
            Texture = pTexture;
            Position = pPosition;
            Velocity = pVelocity;
            Angle = pAngle;
            AngularVelocity = pAngularVelocity;
            Color = pColor;
            Size = pSize;
            TTL = pTtl;
        }
 
        #endregion

        #region Abstract Methods
        /// <summary>
        /// Do Logic for AnimatedSprites
        /// </summary>
        public abstract void Update(GameTime pGameTime);

        /// <summary>
        /// Do drawings for AnimatedSprites
        /// </summary>
        /// <param name="pSpriteBatch">The graphic to draw</param>
        /// <param name="pLocation">The location where it's have to draw</param>
        public abstract void Draw(SpriteBatch pSpriteBatch);

        #endregion
    }
}
